#!/usr/bin/python
# -*- coding: UTF-8 -*-
import random

if __name__ == '__main__':
    info_list = []
    for i in range(0, 1000):
        courseware_info = {}
        courseware_info['url'] = 'http://edu.piesat.cn'
        courseware_info['duration'] = random.randint(0, 78660)
        courseware_info['state'] = 'n' if random.randint(0, 1) > 0 else 'y'
        info_list.append(courseware_info)

    info_list.sort(key=lambda info: info['duration'], reverse=False)
    info_list.sort(key=lambda info: info['state'], reverse=True)
    for info in info_list:
        print(info)